home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_qt.idb / usr / freeware / include / Qt / qwindowdefs.h.z / qwindowdefs.h
Encoding:
C/C++ Source or Header  |  1998-10-28  |  8.1 KB  |  337 lines

  1. /****************************************************************************
  2. ** $Id: qwindowdefs.h,v 2.26 1998/07/03 00:09:42 hanord Exp $
  3. **
  4. ** Definition of general window system dependent functions, types and
  5. ** constants
  6. **
  7. ** Created : 931029
  8. **
  9. ** Copyright (C) 1992-1998 Troll Tech AS.  All rights reserved.
  10. **
  11. ** This file is part of Qt Free Edition, version 1.40.
  12. **
  13. ** See the file LICENSE included in the distribution for the usage
  14. ** and distribution terms, or http://www.troll.no/free-license.html.
  15. **
  16. ** IMPORTANT NOTE: You may NOT copy this file or any part of it into
  17. ** your own programs or libraries.
  18. **
  19. ** Please see http://www.troll.no/pricing.html for information about 
  20. ** Qt Professional Edition, which is this same library but with a
  21. ** license which allows creation of commercial/proprietary software.
  22. **
  23. *****************************************************************************/
  24.  
  25. #ifndef QWINDOWDEFS_H
  26. #define QWINDOWDEFS_H
  27.  
  28. #ifndef QT_H
  29. #include "qobjectdefs.h"
  30. #endif // QT_H
  31.  
  32.  
  33. // Class forward definitions
  34.  
  35. class QApplication;
  36. class QPaintDevice;
  37. class QPaintDeviceMetrics;
  38. class QWidget;
  39. class QWidgetMapper;
  40. class QWindow;
  41. class QDialog;
  42. class QColor;
  43. class QColorGroup;
  44. class QPalette;
  45. class QCursor;
  46. class QPoint;
  47. class QSize;
  48. class QRect;
  49. class QPointArray;
  50. class QPainter;
  51. class QRegion;
  52. class QFont;
  53. class QFontMetrics;
  54. class QFontInfo;
  55. class QPen;
  56. class QBrush;
  57. class QWMatrix;
  58. class QPixmap;
  59. class QBitmap;
  60. class QMovie;
  61. class QImage;
  62. class QImageIO;
  63. class QPicture;
  64. class QPrinter;
  65. class QAccel;
  66. class QTimer;
  67. class QClipboard;
  68.  
  69.  
  70. // Widget list (defined in qwidcoll.h)
  71.  
  72. class QListM_QWidget;                // object list
  73. #define QWidgetList QListM_QWidget
  74.  
  75.  
  76. #if defined(_CC_BOR_) || defined(_CC_WAT_)
  77. #define NEEDS_QMAIN
  78. #endif
  79.  
  80.  
  81. // Window system setting
  82.  
  83. #if defined(_OS_MAC_)
  84. #define _WS_MAC_
  85. #elif defined(_OS_MSDOS_)
  86. #define _WS_WIN16_
  87. #error "Qt requires Win32 and does not work with Windows 3.x"
  88. #elif defined(_WIN32_X11_)
  89. #define _WS_X11_
  90. #elif defined(_OS_WIN32_)
  91. #define _WS_WIN32_
  92. #elif defined(_OS_OS2_)
  93. #define _WS_PM_
  94. #elif defined(UNIX)
  95. #define _WS_X11_
  96. #endif
  97.  
  98. #if defined(_WS_WIN16_) || defined(_WS_WIN32_)
  99. #define _WS_WIN_
  100. #endif
  101.  
  102.  
  103. // Window system dependent definitions
  104.  
  105. #if defined(_WS_MAC_)
  106. #endif // _WS_MAC_
  107.  
  108.  
  109. #if defined(_WS_WIN_)
  110.  
  111. #if defined(_WS_WIN32_)
  112. typedef void *HANDLE;
  113. typedef void *WId;
  114. typedef void *HDC;
  115. #elif defined(_WS_WIN16_)
  116. typedef uint HANDLE;
  117. typedef uint WId;
  118. typedef uint HDC;
  119. #endif
  120. typedef struct tagMSG MSG;
  121.  
  122.  
  123. HANDLE qWinAppInst();
  124. HANDLE qWinAppPrevInst();
  125. int    qWinAppCmdShow();
  126. HANDLE qt_display_dc();
  127.  
  128. enum WindowsVersion { WV_NT, WV_95, WV_32s };
  129.  
  130. #endif // _WS_WIN16_ or _WS_WIN32_
  131.  
  132.  
  133. #if defined(_WS_PM_)
  134.  
  135. typedef ulong HANDLE;
  136. typedef ulong WId;
  137. typedef ulong HAB;
  138. typedef ulong HPS;
  139. typedef ulong HDC;
  140.  
  141. typedef struct _QMSG   QMSG;
  142. typedef struct _POINTL POINTL;
  143. typedef struct _RECTL  RECTL;
  144.  
  145. HAB qPMAppInst();
  146.  
  147. #endif // _WS_PM_
  148.  
  149.  
  150. #if defined(_WS_X11_)
  151.  
  152. typedef unsigned int  WId;
  153. typedef unsigned int  HANDLE;
  154. typedef struct _XDisplay Display;
  155. typedef union  _XEvent XEvent;
  156. typedef struct _XGC *GC;
  157. typedef struct _XRegion *Region;
  158.  
  159. Display *qt_xdisplay();
  160. int     qt_xscreen();
  161. WId     qt_xrootwin();
  162. GC     qt_xget_readonly_gc( bool monochrome=FALSE );
  163. GC     qt_xget_temp_gc( bool monochrome=FALSE );
  164.  
  165. #endif // _WS_X11_
  166.  
  167.  
  168. #if defined(NEEDS_QMAIN)
  169. #define main qMain
  170. #endif
  171.  
  172.  
  173. // Global platform-independent types and functions
  174.  
  175. typedef short QCOORD;                // coordinate type
  176. const int QCOORD_MIN = -32768;
  177. const int QCOORD_MAX =    32767;
  178.  
  179. typedef unsigned int QRgb;            // RGB triplet
  180.  
  181. char *qAppName();                // get application name
  182.  
  183.  
  184. // Misc functions
  185.  
  186. typedef void (*CleanUpFunction)();
  187. void  qAddPostRoutine( CleanUpFunction );
  188.  
  189.  
  190. void *qt_find_obj_child( QObject *, const char *, const char * );
  191. #define CHILD(parent,type,name) \
  192.     ((type*)qt_find_obj_child(parent,#type,name))
  193.  
  194.  
  195. // GUI styles
  196.  
  197. enum GUIStyle {
  198.     MacStyle, // OBSOLETE
  199.     WindowsStyle,
  200.     Win3Style, // OBSOLETE
  201.     PMStyle, // OBSOLETE
  202.     MotifStyle
  203. };
  204.  
  205.  
  206. // Widget flags
  207.  
  208. typedef uint WFlags;
  209.  
  210. const uint WState_Created    = 0x00000001;    // widget state flags
  211. const uint WState_Disabled    = 0x00000002;
  212. const uint WState_Visible    = 0x00000004;
  213. const uint WState_DoHide    = 0x00000008;
  214. const uint WState_ClickToFocus    = 0x00000010;
  215. const uint WState_TrackMouse    = 0x00000020;
  216. const uint WState_BlockUpdates    = 0x00000040;
  217. const uint WState_PaintEvent    = 0x00000080;
  218.  
  219. const uint WType_TopLevel    = 0x00000100;    // widget type flags
  220. const uint WType_Modal        = 0x00000200;
  221. const uint WType_Popup        = 0x00000400;
  222. const uint WType_Desktop    = 0x00000800;
  223.  
  224. const uint WStyle_Customize    = 0x00001000;    // window style flags
  225. const uint WStyle_NormalBorder    = 0x00002000;
  226. const uint WStyle_DialogBorder    = 0x00004000;
  227. const uint WStyle_NoBorder    = 0x00000000;
  228. const uint WStyle_Title        = 0x00008000;
  229. const uint WStyle_SysMenu    = 0x00010000;
  230. const uint WStyle_Minimize    = 0x00020000;
  231. const uint WStyle_Maximize    = 0x00040000;
  232. const uint WStyle_MinMax    = WStyle_Minimize | WStyle_Maximize;
  233. const uint WStyle_Tool        = 0x00080000;
  234. const uint WStyle_Mask        = 0x000ff000;
  235.  
  236. const uint WCursorSet        = 0x00100000;    // misc widget flags
  237. const uint WDestructiveClose    = 0x00200000;
  238. const uint WPaintDesktop    = 0x00400000;
  239. const uint WPaintUnclipped    = 0x00800000;
  240. const uint WPaintClever        = 0x01000000;
  241. const uint WConfigPending    = 0x02000000;
  242. const uint WResizeNoErase    = 0x04000000;
  243. const uint WRecreated        = 0x08000000;
  244. const uint WExportFontMetrics    = 0x10000000;
  245. const uint WExportFontInfo    = 0x20000000;
  246. const uint WFocusSet        = 0x40000000; // not used any more
  247. const uint WState_TabToFocus    = 0x80000000;
  248.  
  249.  
  250. class QFocusData;
  251. #if defined(_WS_WIN_)
  252. class QOleDropTarget;
  253. #endif
  254.  
  255. // Extra QWidget data
  256. //  - to minimize memory usage for members that are seldom used.
  257.  
  258. struct QWExtra {
  259.     GUIStyle guistyle;                // GUI Style
  260.     short    minw, minh;            // minimum size
  261.     short    maxw, maxh;            // maximum size
  262.     short    incw, inch;            // size increments
  263.     char    *caption;                // widget caption
  264.     char    *iconText;                // widget icon text
  265.     QPixmap *icon;                // widget icon
  266. #if defined(_WS_WIN_)
  267.     HANDLE   winIcon;                // internal Windows icon
  268.     QOleDropTarget *dropTarget;            // drop target
  269. #endif
  270.     QPixmap *bg_pix;                // background pixmap
  271.     QFocusData *focusData;            // focus data (for TLW)
  272. #if defined(_WS_X11_)
  273.     void * xic;
  274. #endif
  275.     char     bg_mode;                // background mode
  276.  
  277. #if defined(_WS_X11_)
  278.     uint dnd : 1;                // drop enable
  279. #endif
  280.     uint propagateFont: 2;
  281.     uint propagatePalette: 2;
  282. };
  283.  
  284.  
  285. // Raster operations
  286.  
  287. enum RasterOp                    // raster op/transfer mode
  288.     { CopyROP, OrROP, XorROP, EraseROP,
  289.       NotCopyROP, NotOrROP, NotXorROP, NotEraseROP, NotROP };
  290.  
  291.  
  292. // Text formatting flags for QPainter::drawText and QLabel
  293.  
  294. const int AlignLeft    = 0x0001;        // text alignment
  295. const int AlignRight    = 0x0002;
  296. const int AlignHCenter    = 0x0004;
  297. const int AlignTop    = 0x0008;
  298. const int AlignBottom    = 0x0010;
  299. const int AlignVCenter    = 0x0020;
  300. const int AlignCenter    = AlignVCenter | AlignHCenter;
  301.  
  302. const int SingleLine    = 0x0040;        // misc. flags
  303. const int DontClip    = 0x0080;
  304. const int ExpandTabs    = 0x0100;
  305. const int ShowPrefix    = 0x0200;
  306. const int WordBreak    = 0x0400;
  307. const int GrayText    = 0x0800;
  308. const int DontPrint    = 0x1000;        // internal
  309.  
  310.  
  311. // Image conversion flags
  312.  
  313. // The unusual ordering is caused by compatibility and default requirements.
  314.  
  315. const int ColorMode_Mask         = 0x00000003;
  316. const int AutoColor              = 0x00000000;
  317. const int ColorOnly              = 0x00000003;
  318. const int MonoOnly               = 0x00000002;
  319. //        Reserved               = 0x00000001;
  320. const int AlphaDither_Mask       = 0x0000000c;
  321. const int ThresholdAlphaDither   = 0x00000000;
  322. const int OrderedAlphaDither     = 0x00000004;
  323. const int DiffuseAlphaDither     = 0x00000008;
  324. //        ReservedAlphaDither    = 0x0000000c;
  325. const int Dither_Mask            = 0x00000030;
  326. const int DiffuseDither          = 0x00000000;
  327. const int OrderedDither          = 0x00000010;
  328. const int ThresholdDither        = 0x00000020;
  329. //        ReservedDither         = 0x00000030;
  330. const int DitherMode_Mask        = 0x000000c0;
  331. const int AutoDither             = 0x00000000;
  332. const int PreferDither           = 0x00000040;
  333. const int AvoidDither            = 0x00000080;
  334.  
  335.  
  336. #endif // QWINDOWDEFS_H
  337.